<template>
  <div class="index">
    <transition name="fade" mode="out-in">
        <router-view></router-view>
    </transition>

      <!-- 底部导航 -->
    <div class="tabbar">
    <van-tabbar v-model="active">
        <van-tabbar-item v-for="(item,index) in btnArr" :key="index" :icon="item.icon" :to="item.to">{{item.name}}</van-tabbar-item>
    </van-tabbar>
  </div>
  
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
      btnArr:[
        {
          icon:'wap-home',
          name:'首页',
          to:'/index/home'
        },
        {
          icon:'hot',
          name:'爆爆团',
          to:'/index/tuan'
        },
        {
          icon:'todo-list',
          name:'订单',
          to:'/index/order'
        },
        {
          icon:'manager',
          name:'我的',
          to:'/index/mine'
        }
      ]
    };
  },
}
</script>

<style lang='scss' scoped>

/* 入场动画 */
.fade-enter{ /*动画开始时的状态*/
  opacity: 0;
}
.fade-enter-active{
  transition: all .2s;
}
.fade-enter-to{ /*动画结束时的状态*/
  opacity: 1;
}

/* 离场动画 */
.fade-leave{ /*动画开始时的状态*/
  opacity: 1;
}
.fade-leave-active{
  transition: all .2s;
}
.fade-leave-to{ /*动画结束时的状态*/
  opacity: 0;
}
</style>